package com.web.servlet;

import com.web.entity.Student;
import com.web.service.StudentService;
import javax.servlet.annotation.WebServlet;
import com.web.serviceimpl.StudentServiceImpl;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 根据班级查看班级列表
 * @author 12270
 */
@WebServlet("/ssls")
public class SearchStudentListServlet extends HttpServlet{
    
    StudentService studentService = new StudentServiceImpl();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        String ClassID = req.getParameter("ClassID");
        
        List<Student> list= studentService.findStudentsByClassID(ClassID);

        req.setAttribute("stu", list);
        req.getRequestDispatcher("SearchStudentsList.jsp").forward(req, resp);
        
    }
}
